package org.wenshu.ai.modular.chat.provider.core;

import dev.langchain4j.model.chat.ChatLanguageModel;
import dev.langchain4j.model.embedding.EmbeddingModel;
import org.springframework.stereotype.Service;
import org.wenshu.ai.modular.chat.provider.pojo.ChatModelConfig;
import org.wenshu.ai.modular.chat.provider.pojo.EmbeddingModelConfig;

@Service
public class InMemoryModelFactory implements ModelFactory{
    public static final String PROVIDER = "IN_MEMORY";

    @Override
    public ChatLanguageModel createChatModel(ChatModelConfig modelConfig) {
        throw new UnsupportedOperationException("Not supported yet.");
    }

    @Override
    public EmbeddingModel createEmbeddingModel(EmbeddingModelConfig embeddingModel) {

        String modelName = embeddingModel.getModelName();
//        if (EmbeddingModelConstant.BGE_SMALL_ZH.equalsIgnoreCase(modelName)) {
//            return EmbeddingModelConstant.BGE_SMALL_ZH_MODEL;
//        }
        if (EmbeddingModelConstant.ALL_MINILM_L6_V2.equalsIgnoreCase(modelName)) {
            return EmbeddingModelConstant.ALL_MINI_LM_L6_V2_MODEL;
        }
        return EmbeddingModelConstant.ALL_MINI_LM_L6_V2_MODEL;
    }


}
